<template>
	<view class="wrap" >
		<image class="bgs" src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/12.png" mode="widthFix"></image>
		<view class="reg-text">无忧赚</view>
		<view class="desc">
			欢迎开启无忧生活
		</view>
		<view class="list">
			<view class="list-call">
				<view class="tit">
					请输入您的手机号码
				</view>
				
			<!-- 	<view class="iconfont icon-shouji" style="font-size: 22px;color:#ddd;"></view>
				<u-field icon-color="#ddd" :placeholder-style="colo" v-model="phoneNo" label="+86"
					placeholder="请输入您的手机号码" style="width: 100%;">
				</u-field> -->
			</view>
			<view class="ipt">
				<u-input class="inp" placeholder="请输入您的手机号码" border-color="" v-model="phoneNo" type="number" :border="false" />
			</view>
		</view>
		
		<view class="bottom-box1">
			<view  class="copyright">
				<view @click="checked=!checked" class="check">
					
					<image  v-if="checked" class="yes" src="https://wuyouzhuanapp.oss-cn-beijing.aliyuncs.com/cheked.png" mode=""></image>
					<view  v-else class="no"></view>
				</view>
				<text @click="checked=!checked">我已阅读并同意</text>
				<text class="url">《无忧赚用户协议》</text>和
				<text class="url">《无忧赚隐私协议》</text>
			</view>
		</view>
		<view class="button" @click="getCode()"><text>获取验证码</text></view>
		
	</view>
</template>
<script>
	export default {
		data() {
			return {
				checked:false,
				phoneNo: '',
				colo: {
					color: '#ddd',
					
				}
			};
		},
		onLoad() {},
		methods: {
			getCode() {
				if(!this.checked){
					this.$u.toast("请阅读并勾选用户协议与隐私政策！");
					return
				}
				if(!this.phoneNo){
					this.$u.toast("请先输入手机号码！");
					return
				}
				// uni.showLoading({
				// 	title: '正在获取验证码',
				// 	mask: true
				// })
				
				
				this.$u.api.sendCode({
						phoneNo: this.phoneNo,
						validCodeType: '1'
					})
					.then(res => {
						if (res.code == '200') {
							setTimeout(() => {
								uni.navigateTo({
									url: '/pages/sys/login/registerCode?phoneNo=' + this.phoneNo
								});
							}, 500);
						} else {
							this.$u.toast(res.msg);
						}
					});
			}
		}
	};
</script>
<style lang="scss" scoped>
	@import 'index.scss';
	.ipt{
		padding: 0 42rpx;
		border-radius: 88rpx;
		border: 1px solid #fff;
		background: #627dff;
		height: 88rpx;
		display: flex;
		align-items: center;
	}
	/deep/ .uni-input-input{
		color: #fff !important;
		font-size: 36rpx;
		font-family: PingFang HK-Regular, PingFang HK;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 42rpx;
	}
	// .inp{
	// 	color: #fff !important;
	// }
	.tit{
		font-size: 32rpx;
		font-family: PingFang HK-Light, PingFang HK;
		font-weight: 300;
		color: rgba(255,255,255,0.47);
		line-height: 38rpx;
	}
	.check{
		margin-right: 8rpx;
		.no{
			width: 30rpx;
			height: 30rpx;
			border: 1px solid #fff;
			border-radius: 50%;
			
		}
		.yes{
			width: 32rpx;
			height: 32rpx;
		}
	}

	.u-field {
		color: #ddd;
	}

	.agreement {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-left: 90rpx;
		color: #666;
	}

	.uni-input-placeholder {
		font-size: 32rpx;
	}

	.uni-input-input {
		font-size: 32rpx;
	}

	.bottom-box {
		position: fixed;
		bottom: 40rpx;
		text-align: center;
		width: 100%;
	}

	.copyright {
		display: flex;
		// align-items: center;
		justify-content: center;
		color: #939393;
		width: 100%;
		font-size: 24rpx;

		.u-link {
			margin: 0 10rpx;
			font-size: 24rpx !important;
			color: #FFFFFF !important;
		}
	}
</style>
